

#include <iostream>

class base {

    public:
        void print(int i ) { std::cout << "base print int i " << i << std::endl;}
        void print(float i) { std::cout << "base print float i " << i << std::endl;}
};

class derived : public base {

    public:
        void print(char i ) { std::cout << "derived print char i " << i << std::endl;}
        void print(float i) { std::cout << "derived print float i "<< i << std::endl;}

};

void test_case1() {

    int i = 0;
    float j = 9;

    base base1; 
    base1.print(i);
    base1.print(j);

}

void test_case2() {

    char i = 'c';
    derived d1;
    d1.print(i);

    //can't pass the compilation
    //int m = 10;
    //d1.print(m);
}

void test_case3() {

    derived d1;

    base* p_base = &d1;
    derived* p_derived = &d1;

    float f = 9;

    p_base->print(f);
    p_derived->print(f);
}

int main() {

    test_case1();
    test_case2();

    test_case3();

    return 0;
}